class Main extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            partnername: '欢欢',
            minute: 60,
            danjia: '119.00',
            avatar: './src/girl2.jpg',
            count: 1,
            xmje: 119,
            chefei: 10,
            couponmoney:0,
            couponword: '暂无优惠券',
            mingxiname: '礼仪模特',
            mingxisrc: './src/girl2.jpg',
            lichen: '2.2', qibu: '3.00', chaochu: '5.00', kmfee: '2.0'
        };
    }









    componentDidMount() {
        if (Constant.SWITCH_VCONSOLE) {
            new VConsole();
        }

        let openid = localStorage.getItem('openid')
        // getuser(openid, res => {
        //     if (res.issuccess == 1) {
        //         let user = res.user
        //         this.setState({ user, allprice:835, amount:  835 })
        //     }
        // })

        // let sizehtml = [],cphtml=[], { sizelist } = this.state;

        // sizehtml.push(<option value={-1}>请选择</option>)
        // sizelist.forEach((x, i) => {
        //     sizehtml.push(
        //         <option key={i} value={x}>{x} </option>
        //     )
        // })
        // cphtml.push(<option value={1}>大包(￥535元)</option>)
        // cphtml.push(<option value={0}>小包(￥310元)</option>)
        // cphtml.push(<option value={-1}>不购买</option>)

        // this.setState({ sizehtml,openid,cphtml })

        //  console.log(liststr?'1':'2','liststr');
        // let list = JSON.parse(localStorage.getItem('orderlist')) || []
        // console.log(list, 'list');

        // this.setState({ list }, () => {
        //     this.getamount()
        // })
        // this.getdata()

    }











    selectchange(e) {
        let { value } = e.target
        this.setState({ sizeid: value })
    }



    clickcate(name) {
        let { cate } = this.state
        if (cate != name) {
            this.setState({ cate: name })
        }
    }
    toinfo(id) {
        window.location.href = './cateinfo.html'
    }



    render() {
        let { partnername, count, couponword,couponmoney, xmje, chefei, avatar, mingxisrc, danjia, minute, mingxiname, lichen, qibu, chaochu, kmfee } = this.state;


        return (
            <div id="app">
                <div className="d1">
                    <div className="item">
                        <div className="left">
                            <img src="./src/location.png" alt="" />
                            <p>请选择地址</p>
                        </div>
                        <img src="./src/right.png" alt="" className="rightimg" />
                    </div>
                    <div className="item">
                        <div className="left">
                            <img src="./src/people.png" alt="" />
                            <p>伙伴</p>
                        </div>
                        <div className="right">
                            <p>{partnername}</p>
                            <img src={avatar} alt="" />

                        </div>
                    </div>
                    <div className="item chuxing">
                        <div className="topp">
                            <div className="left">
                                <img src="./src/xingli.png" alt="" />
                                <p>出行方式</p>
                            </div>
                            <p>滴滴打车</p>
                        </div>
                        <div className="btm">
                            全程共<span>{lichen}km</span>
                            {/* <p className="p_biaoji">{lichen}km</p> */}
                            ，出租出行收取来回车费,<span>起步{qibu}元</span>
                            。超出<span>{chaochu}</span>公里,按<p>每公里<span>{kmfee}元</span>计算车费</p>
                        </div>
                    </div>
                    <div className="item">
                        <div className="left">
                            <img src="./src/clock.png" alt="" />
                            <p>服务时间</p>
                        </div>
                        <div className="right">
                            <p>到达</p>
                            <img src="./src/right.png" alt="" className="right" />
                        </div>
                    </div>
                </div>

                <div className="d1 mingxi">
                    <div className="item">
                        <div className="left">
                            <p>订单明细</p>
                        </div>
                    </div>

                    <div className="item chuxing">
                        <div className="topp">
                            <div className="left">
                                <img src={mingxisrc} alt="" />
                                <div>
                                    <p>{mingxiname}</p>
                                    <p className="shichang">服务时长：<span>{minute}分钟</span></p>
                                    <p className="danjia">￥{danjia}</p>
                                </div>
                            </div>
                            <div className="right">
                                <div>
                                    <img src="./src/reduce.png" alt="" />
                                    <p>{count}</p>
                                    <img src="./src/plus.png" alt="" />
                                </div>
                            </div>
                        </div>
                        <div className="topp">
                            <p>项目金额</p>
                            <span>￥{xmje}</span>
                        </div>
                        <div className="topp">
                            <p>车费</p>
                            <span>￥{chefei}</span>
                        </div>
                        <div className="btm gray">
                            若预约凌晨时间，XX上门难度增大，出行费用将上调
                        </div>
                        <div className="topp zong">
                            <p>总计</p>
                            <span>￥{(xmje + chefei).toFixed(2)}</span>
                        </div>
                    </div>

                </div>

                <div className="d1">



                    <div className="item coupon">
                        <div className="left">
                            <p>优惠券</p>
                            <p >{couponword}</p>
                        </div>
                        <div className="right">
                            <img src="./src/right.png" alt="" className="right" />
                        </div>
                    </div>
                </div>

                <div className="d1">



                    <div className="item beizhu">
                        <div className="left">
                            <p>备注</p>
                        </div>
                        <div className="right">
                            {/* <textarea type="text" placeholder="请输入备注"  /> */}
                            <input type="text" placeholder="请输入备注" />
                        </div>
                    </div>
                </div>

                <div className="d1 notice">
                    <div className="item">
                        <div>
                            <img src="./src/notice_zhuanye.png" alt="" />
                            专业正规
                        </div>
                        <p>提供正规、专业的陪玩服务，平台伙伴均具备专业素质，可放心预约点单</p>
                    </div>
                     <div className="item">
                        <div>
                            <img src="./src/notice_aixin.png" alt="" />
                            安心服务
                        </div>
                        <p>伙伴接受专业培训，禁止小费行为</p>
                    </div>
                     <div className="item">
                        <div>
                            <img src="./src/notice_hudun.png" alt="" />
                            号码保护
                        </div>
                        <p>为了保护您的隐私安全，已对伙伴隐藏您的真实手机号，为了保障服务质量，开启号码保护的订单通话可能会被录音</p>
                    </div>

                </div>

                <div className="bottom">
                    <div className="left">
                        <p>￥{(xmje + chefei).toFixed(2)}</p>
                        <p>已优惠{couponmoney}元</p>
                    </div>
                    <div className="right">立即支付</div>
                </div>

            </div>
        )
    }
}

ReactDOM.render(
    <div>
        {/* <TopLine /> */}
        <div id='body'>
            <Main />
        </div>
    </div>
    // <Barrage />
    , $('.container')[0]
)